package com.pz.gulimall.search.vo.res;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.pz.gulimall.common.to.es.SkuEsModelTo;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

@Data
public class SearchResVo {

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<SkuEsModelTo> products;

    /**
     * 查询结果的所有品牌，聚合结果
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<BrandVo> brands;

    /**
     * 查询结果的所有属性，聚合结果
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<AttrVo> attrs;

    /**
     * 查询结果的所有类别，聚合结果
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<CategoryVo> categories;

    private Long total;

    @Data
    @AllArgsConstructor
    public static class CategoryVo {
        private Long catalogId;
        private String catalogName;
    }

    @Data
    @AllArgsConstructor
    public static class BrandVo {
        private Long brandId;
        private String brandName;
        private String brandImg;
    }

    @Data
    @AllArgsConstructor
    public static class AttrVo {
        private Long attrId;
        private String attrName;

        /**
         * 15_海思（Hisilicon）:麒麟985
         */
        private String attrValue;
    }
}
